<p><code>instanceof</code> operators that always return <code>true</code> or <code>false</code> are either useless or the result of a misunderstanding
which could lead to unexpected behavior in production.</p>
<h2>Noncompliant Code Example</h2>
<pre>
public boolean isSuitable(Integer param) {
...
  String name = null;

  if (name instanceof String) { // Noncompliant; always false since name is null
    //...
  }

  if(param instanceof Number) {  // Noncompliant; always true unless param is null, because param is an Integer
    doSomething();
  }
...
}
</pre>
<h2>Compliant Solution</h2>
<pre>
public boolean isSuitable(Integer param) {
...
  doSomething();
...
}
</pre>
<h2>Deprecated</h2>
<p>This rule is deprecated; use {rule:java:S2589} instead.</p>

